package org.travel_system.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.travel_system.pojo.ComplaintHandLing;

import java.util.List;

@Mapper
public interface ComplaintHandlingMapper {

    //查询处理结果
    @Select("SELECT * FROM complaint_handling WHERE complaint_id = #{complaintId}")
    List<ComplaintHandLing> getComplaintHandling(Integer complaintId);

    //添加处理结果
    @Insert("insert into complaint_handling(handling_content, handling_photo, complaint_id,handling_video) " +
            "values (#{handlingContent}, #{handlingPhoto}, #{complaintId},#{handlingVideo} )")
    int addComplaintHandling(ComplaintHandLing complaintHandLing);

    //删除处理结果
    @Delete("delete from complaint_handling where handling_id = #{handlingId}")
    int deleteComplaintHandling(int handlingId);
}
